﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var yesnoData = Jxstar.findComboData('yesno');
	var auditData = Jxstar.findComboData('audit');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'trigger', fieldLabel:'项目编号', name:'project_check__project_code',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:20, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'project_select', layoutPage:'', sourceField:'project_base.project_code;project_name;project_id;dept_name;dept_id;project_user;project_useid', targetField:'project_check.project_code;project_name;project_id;dept_name;dept_id;project_user;project_useid', whereSql:"project_status < '6'", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'project_check.project_code'};
							JxSelect.createSelectWin(selcfg, this, 'node_project_check_form');
						}},
					{xtype:'textfield', fieldLabel:'实施部门', name:'project_check__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'验收负责人', name:'project_check__check_user', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'参加人员', name:'project_check__other_user', anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'登记人', name:'project_check__edit_user', defaultval:'fun_getUserName()', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'fileuploadfield', fieldLabel:'上传验收单', name:'project_check__check_file', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', readOnly:true, anchor:'100%'},
					{xtype:'combo', fieldLabel:'是否单项验收', name:'project_check__check_contract', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: yesnoData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: yesnoData[0][0]},
					{xtype:'combo', fieldLabel:'记录状态', name:'project_check__auditing', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'hidden', fieldLabel:'项目ID', name:'project_check__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'部门ID', name:'project_check__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'登记人ID', name:'project_check__edit_userid', defaultval:'fun_getUserId()', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'项目名称', name:'project_check__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'project_check__project_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'numberfield', decimalPrecision:2, fieldLabel:'实际工期(月)', name:'project_check__project_month', anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'验收日期', name:'project_check__check_date', defaultval:'fun_getToday()', format:'Y-m-d', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%'},
					{xtype:'datefield', fieldLabel:'竣工日期', name:'project_check__end_date', format:'Y-m-d', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%'},
					{xtype:'numberfield', allowDecimals:false, fieldLabel:'质保期(月)', name:'project_check__quality_month', anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'登记单号', name:'project_check__check_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'hidden', fieldLabel:'验收负责人ID', name:'project_check__check_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主键', name:'project_check__check_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人id', name:'project_check__project_userid', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'项目实施情况', name:'project_check__done_content', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'验收纪要', name:'project_check__check_desc', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'质量评定', name:'project_check__check_result', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'备注', name:'project_check__check_memo', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'project_check'
	};

	
	config.eventcfg = {				mycheck: function(){			var keyid = this.getPkField().getValue();			if (keyid == null || keyid.length == 0) {				JxHint.alert(jx.event.nosave);	//当前记录没有保存，不能操作！				return;			}						var self = this;			//取选择记录的主键值			var params = 'funid='+ self.define.nodeid;			params += '&keyid=' + keyid;			//设置请求的参数			params += '&pagetype=form&eventcode=mycheck';			//执行处理的内容			var endcall = function(data) {				//重新加载数据				//self.grid.getStore().reload();			};			//发送请求			Request.postRequest(params, endcall);		}
	};
	
	return new Jxstar.FormNode(config);
}